import {Component} from '@angular/core';
import {GnTable} from "geminis-ng";
import {RoleEditComponent} from "../edit/role-edit.component";
import {RoleFuncComponent} from "../func/role-func.component";
import {RoleManageComponent} from "../manage/role-manage.component";
import {GnTableColumn} from "geminis-ng/data/table.component";

@Component({
  selector: 'gn-manage-role-list',
  templateUrl: './role-list.component.html'
})
export class RoleListComponent extends GnTable {

  typeEdit = RoleEditComponent;
  typeFunc = RoleFuncComponent;
  typeManage = RoleManageComponent;

  columns: GnTableColumn[] = [
    {label: '名称', field: 'name'},
    {label: '功能', field: 'functions', formatter: row => row.functions.map(func => func.name).join(",")}
  ];
}
